package calao.storage;

import java.util.regex.Pattern;

public class MatchCondition 
extends FieldCondition 
{

	final Pattern pattern;

	public MatchCondition(Field<String> field, String value)
	{
		super(field);
		pattern = Pattern.compile(value);
	}

	public boolean matches(Object value)
	{
		if (value==null) return false;
		return pattern.matcher((String)value).matches();
	}

}
